from game.client.gui.gui_manager import *
from game.client.io.resource_manager import *
from game.client.render.MainRenderer import *
from game.client.render.Camera import *
from game.client.model.client_model import *
from game.client.gamestate.gamestate_manager import *
from game.client.gamestate.free_state import *
from game.client.gamestate.mainmenu_state import *
from game.object.entity import *

class GameData:

    def __init__(self, scr_size):

        self.clock = pygame.time.Clock()
        self.res_mgr = ResourceManager()
        self.player = Entity()
        self.camera = Camera()
        self.renderer = MainRenderer(self)
        self.gui = GuiManager(scr_size[0], scr_size[1])

        self.state = GamestateManager({
            "free": FreeState(),
            "main_menu": MainMenuState()
        })

        self.model = ClientModel(self)
        self.model.first_load()
        
        self.renderer.resize(*scr_size)
        self.renderer.init()

        self.quit = 0

    def quit_game(self, code=1):
        self.quit = code